package com.hxkj.controller.userCenter;

import com.github.pagehelper.PageInfo;
import com.hxkj.domain.po.CertExpert;
import com.hxkj.domain.vo.ExpertAuditRecordVO;
import com.hxkj.service.userCenter.AuditExpertService;
import com.platform.common.domain.to.PageTo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.concurrent.Callable;

/**
 * @author zhangheng
 * @date 2018-10-11 19:44
 */
@RestController
@RequestMapping("/auditExpert")
public class AuditExpertController {

    @Autowired
    private AuditExpertService auditExpertService;

    @RequestMapping(value = "/getList")
    public Callable<PageInfo<CertExpert>> getList(@ModelAttribute CertExpert expert, @ModelAttribute PageTo pageParam) throws Exception{
        return () ->auditExpertService.getList(expert, pageParam);
    }

    @RequestMapping(value = "/getInfo")
    public Callable<CertExpert> getInfo(@ModelAttribute CertExpert expert) throws Exception{
        return () ->auditExpertService.getInfo(expert);
    }

    @RequestMapping(value = "/getAuditList")
    public Callable<ExpertAuditRecordVO> getAuditList(@ModelAttribute CertExpert expert) throws Exception{
        return () ->auditExpertService.getAuditList(expert);
    }

    @RequestMapping(value = "/auditExpert")
    public void auditExpert(@ModelAttribute CertExpert expert) throws Exception{
        auditExpertService.auditExpert(expert);
    }

}
